﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace AliveCMS.Models
{
    public class SiteViewModel
    {
        public Guid SiteId { get; set; }
        public string Name { get; set; }
        public List<string> Domains { get; set; }
        public IEnumerable<PageViewModel> Pages
        {
            get
            {
                return MvcApplication.Pages.Where(n => n.SiteId == this.SiteId);
            }
        }
    }

    public class PageViewModel
    {
        public Guid SiteId { get; set; }
        public Guid PageId { get; set; }
        public string Name { get; set; }
        public Guid? ParentPageId { get; set; }
        public IEnumerable<ContentAreaViewModel> ContentAreas
        {
            get
            {
                return MvcApplication.ContentAreas.Where(n => n.PageId == this.PageId);
            }
        }
    }


    public class ContentAreaViewModel
    {
        public Guid ContentAreaId { get; set; }
        public Guid PageId { get; set; }
        public string HtmlId { get; set; }
    }

    public class HtmlContentViewModel : IContentViewModel
    {
        public Guid HtmlContentId { get; set; }
        public string Content { get; set; }
        public int SortOrder { get; set; }
    }

    public class TabContentViewModel : IContentViewModel
    {
        public Guid TabContentId { get; set; }
        public string Content { get; set; }
        public int SortOrder { get; set; }
        public List<KeyValuePair<string,string>> TabContent { get; set; }


    }


    public interface IContentViewModel
    {
        string Content { get; set; }
        int SortOrder { get; set; }
    }


}